package com.qk.management.scheduled;

import com.qk.management.service.OSSReconciliationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * OSS数据对账定时任务
 */
@Slf4j
@Component
public class OSSReconciliationScheduler {

    @Autowired
    private OSSReconciliationService ossReconciliationService;


//    @Scheduled(cron = "30 * * * * ?")
    public void scheduleReconciliation() {
        log.info("开始执行OSS数据对账任务");
        try {
            ossReconciliationService.reconcile();
            log.info("OSS数据对账任务执行完成");
        } catch (Exception e) {
            log.error("OSS数据对账任务执行失败", e);
        }
    }
}